// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   CompanyProfileService.java

package com.nervytech.tutorcruise.db.service.impl;

import com.nervytech.tutorcruise.db.dao.interfaces.ICompanyProfileDAO;
import com.nervytech.tutorcruise.db.dao.model.CompanyProfile;
import com.nervytech.tutorcruise.db.service.interfaces.ICompanyProfileService;
import com.nervytech.tutorcruise.service.exception.TrainerCruiseServiceException;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("companyProfileService")
public class CompanyProfileService implements ICompanyProfileService {

	@Autowired
	private ICompanyProfileDAO companyProfileDao;

	public void saveCompanyProfile(CompanyProfile companyprofile) {
	}

	public CompanyProfile getCompanyProfile(long userId)
			throws TrainerCruiseServiceException {
		CompanyProfile instProfile = null;
		List<CompanyProfile> list = null;
		try {
			list = companyProfileDao.getCompanyProfile(userId);
			if (list.size() > 0)
				instProfile = (CompanyProfile) list.get(0);
		} catch (Exception e) {
			e.printStackTrace();
			throw new TrainerCruiseServiceException(e.getMessage());
		}
		return instProfile;
	}

	public void updateCompanyProfile(CompanyProfile companyprofile) {
	}

	public void updateFirstLogin(long userId, String phone, String website,
			String address, String contactPersonName, String contactPersonEmail)
			throws TrainerCruiseServiceException {
		try {
			companyProfileDao.updateFirstLogin(userId, phone, website, address,
					contactPersonName, contactPersonEmail);
		} catch (Exception e) {
			throw new TrainerCruiseServiceException(e.getMessage());
		}
	}

}
